// import axios from 'axios';
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex);

const historyOptions = {
    namespaced: true,
    actions: {},
    mutations: {
        IFLogined(state, value) {
            state.ifLogined = value;
        },
        changeIfgoBack(state, payload) {
            state.ifgoBack = payload;
        }
    },
    state: {
        hisArray: JSON.parse(localStorage.getItem('history')) || [],
        ifLogined: JSON.parse(localStorage.getItem("userInfo")) == null ? false : true,
        ifgoBack: false
    }
}

export default new Vuex.Store({
    modules: {
        historyOptions: historyOptions,
    }
})